﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;

namespace TipokHostContract
{
    public class ProxyFactory<T> : ClientBase<T> where T : class
    {
        public ProxyFactory(Binding b, EndpointAddress e)
            : base(b, e)
        {
        }

        public T CreateProxy()
        {
            T interFce = base.CreateChannel();
            return interFce;
        }

        public void CloseProxy()
        {
            try
            {
                this.Close();
            }
            catch
            {
                this.Abort();
            }
        }
    }
}
